{-include file=$smarty.const.B_DIR|cat:'/src/_header.htm'-}

<script type="text/javascript">
Ext.onReady(function() {
	Ext.QuickTips.init();
	var form = new Ext.form.FormPanel({
		baseCls: 'x-plain',
		labelWidth: 55,
		url:'login.php?{-$sess_name-}={-$sess_id-}',
		defaultType: 'textfield',

		items: [ {
			xtype: 'textarea',
			hideLabel: true,
			anchor: '100% -53'
		},{
			fieldLabel: '用户名',
			allowBlank: false,
			minLength: 4,
			maxLength: 12,
			name: 'sName',
			anchor:'100%'  // anchor width by percentage
		},{
			inputType: 'password',
			allowBlank: false,
			minLength: 3,
			maxLength: 12,
			fieldLabel: '密码',
			name: 'sPasswd',
			anchor: '100%'  // anchor width by percentage
		}]
	});

	var window = new Ext.Window({
		title: '登录',
		width: 500,
		height:300,
		minWidth: 300,
		minHeight: 200,
		 closable : false,
		layout: 'fit',
		plain:true,
		bodyStyle:'padding:5px;',
		buttonAlign:'center',
		items: form,

		buttons: [{
			text: '确认',
			handler: function(){
				if( !form.form.isValid()){
					return false;
				}
				form.form.submit({
					method: 'POST',
					waitMsg: '验证中..',
					success: function(form, action) {
						/*
						var o = {
							title: "注意" ,
							msg: "登录完成!" ,
							buttons: Ext.Msg.OK,
							icon: Ext.MessageBox.OK,
							fn: function(){
								location.reload();
							}
						};
						Ext.MessageBox.show(o);
						*/
						location.reload();
					},
					failure: function(form , action){ //()  response.responseText
						var o = {
							title: "注意" ,
							msg: action. result.msg ,
							buttons: Ext.Msg.OK,
							icon: Ext.MessageBox.ERROR
						};
						Ext.MessageBox.show(o);
					}
				});
			}
		},{
			text: '取消',
			handler: function(){
				form.getForm().getEl().dom.reset();
			}
		}]
	});

	window.show();


});
</script>


{-include file=$smarty.const.B_DIR|cat:'/src/_footer.htm'-}